<div class="title">商品回收站</div>
<div class="top-button">
	相关操作：<a href="{:U('Goods/index')}" class="light">商品列表</a>
</div>
<div class="list full">
	<table>
		<tr><th class="t1">商品分类</th><th>商品名称</th><th width="100">库存</th><th width="60">上架</th><th width="60">推荐</th><th width="120">操作</th></tr>
		<foreach name="goods.data" item="v">
			<tr><td class="t1">
				<empty name="v.category_id">未分类<else/>{$v.category_name}</empty>
			</td>
			<td>{$v.name}</td><td>{$v.stock}</td>
			<td><eq name="v.on_sale" value="yes">是<else/>否</eq></td>
			<td><eq name="v.recommend" value="yes">是<else/>否</eq></td><td>
			<a href="#" class="act-rec" data-id="{$v.id}">恢复</a>　<a href="#" class="act-del" data-id="{$v.id}">删除</a></td></tr>
		</foreach>
	</table>
</div>
<div class="pagelist">{$goods.pagelist}</div>
<form method="post" id="form">
	<input type="hidden" name="id" id="target_id">
</form>
<script>
	//彻底删除
	$(".act-del").click(function(){
		if(confirm('确定要彻底删除吗？')){
			$("#target_id").val($(this).attr("data-id"));
			$("#form").attr("action","{:U('Recycle/del',array('p'=>$p))}").submit();
		}
	});
	//恢复
	$(".act-rec").click(function(){
		$("#target_id").val($(this).attr("data-id"));
		$("#form").attr("action","{:U('Recycle/rec',array('p'=>$p))}").submit();
	});
</script>